import { LinValidator, Rule } from "../code/lin-validator-v2"
export class AddRate extends LinValidator {
    constructor() {
        super()
        this.message = [new Rule('isLength', '最大200个字', {
            max: 200
        })]
        this.id = [new Rule('isInt', 'ID有误')]
    }
}

export class RateValidator extends LinValidator {
    constructor() {
        super()
        this.limit = [new Rule('isLength', '一页数据不超100条', {
            max: 2
        })]
        this.page_index = []
    }
    validateId(vals: { body: { TemplateId: any; RateId: any } }) {
        const TemplateId = vals.body.TemplateId
        const RateId = vals.body.RateId
        if (!RateId && !TemplateId)
            throw new Error('ID不存在')
    }
}